<template>
    <el-dialog title="调账查看" :visible.sync="dialogForm" width="800px">
        <el-form :inline="true" ref="form" :model="form"  label-width="120px">
            <el-row>
                <el-col :span="12">
                    <el-form-item label="结算单位：" prop="accountUnit">
                        {{form.accountUnit}}
                    </el-form-item>
                </el-col>
                <el-col :span="12">
                    <el-form-item label="调账月度：" prop="accountMonth">
                        {{form.accountMonth}}
                    </el-form-item>
                </el-col>
            </el-row>
            <el-row>
                <el-col :span="12">
                    <el-form-item label="作业港口：" prop="showPortCode">
                        {{form.portCode | _filterPortCode}}
                    </el-form-item>
                </el-col>
                <el-col :span="12">
                    <el-form-item label="作业类型：" prop="planType">
                        {{form.planType | _filterAllJobStatusNew}}
                    </el-form-item>
                </el-col>
            </el-row>
            <el-row>
                <el-col :span="12">
                    <el-form-item label="调账类型：" prop="accountChangeType">
                        {{form.accountChangeType == 'ONE' ? '一个单位调账' : '两个单位互调'}}
                    </el-form-item>
                </el-col>
                <el-col :span="12" v-if="form.accountChangeType != 'ONE'">
                    <el-form-item label="对方单位：" prop="accountSideUnit">
                        {{form.accountSideUnit}}
                    </el-form-item>
                </el-col>
            </el-row>
            <el-row>
                <el-col :span="12">
                    <el-form-item label="调账方式：" prop="accountChangeWay">
                        <span :style="form.accountChangeWay == 'ADD' ? 'color:red' : 'color:green'">{{form.accountChangeWay == 'ADD' ? '增补' : form.accountChangeWay == 'REDUCE' ? '扣减' :''}}</span>
                    </el-form-item>
                </el-col>
                <el-col :span="12" v-if="form.accountChangeType != 'ONE'">
                    <el-form-item label="对方调整：" prop="accountSideChangeWay">
                        <span :style="form.accountSideChangeWay == 'ADD' ? 'color:red' : 'color:green'">{{form.accountSideChangeWay == "" ? "" : (form.accountSideChangeWay == "ADD" ? '增补' :'扣减')}}</span>
                    </el-form-item>
                </el-col>
            </el-row>
            <el-row>
                <el-col :span="24">
                    <el-form-item label="调整箱量：" prop="feeNum">
                        {{form.feeNum}}{{form.feeNum == '' ? '' : 'TEU'}}
                    </el-form-item>
                </el-col>
            </el-row>
            <el-row>
                <el-col :span="12">
                    <el-form-item label="调整费率：" prop="feePrice">
                        {{form.feePrice}}{{form.feePrice == '' ? '' : '元'}}
                    </el-form-item>
                </el-col>
                <el-col :span="12" v-if="form.accountChangeType != 'ONE'">
                    <el-form-item label="对方调整费率：" prop="feeSidePrice">
                        {{form.feeSidePrice}}{{form.feeSidePrice == '' ? '' : '元'}}
                    </el-form-item>
                </el-col>
            </el-row>
            <el-row>
                <el-col :span="12">
                    <el-form-item label="调整金额：" prop="money">
                        {{form.money == '' ? '' : Number(form.money).toFixed(2)}}{{form.money == '' ? '' : '元'}}
                    </el-form-item>
                </el-col>
                <el-col :span="12" v-if="form.accountChangeType != 'ONE'">
                    <el-form-item label="对方调整金额：" prop="sideMoney">
                        {{form.sideMoney == '' ? '' : Number(form.sideMoney).toFixed(2)}}{{form.sideMoney == '' ? '' : '元'}}
                    </el-form-item>
                </el-col>
            </el-row>
            <el-row>
                <el-col :span="24">
                    <el-form-item label="调整备注：" prop="remark">
                        {{form.remark}}
                    </el-form-item>
                </el-col>
            </el-row>
            <el-row>
                <el-col :span="12">
                    <el-form-item label="调账人：" prop="">
                        {{form.feeUser}}
                    </el-form-item>
                </el-col>
                <el-col :span="12">
                    <el-form-item label="调账时间：" prop="">
                        {{form.feeTime}}
                    </el-form-item>
                </el-col>
            </el-row>
        </el-form>
        <span slot="footer" class="dialog-footer">
            <el-button @click="dialogForm = false">取 消</el-button>
            <el-button type="primary" @click="dialogForm = false">确 定</el-button>
        </span>
    </el-dialog>
</template>

<script>
    import { addOrChangeAccount, getChangeAccountBill } from "@/api/balance/balance";

    export default {
        name: "adjustDetail",
        components: {  },
        data() {
            return {
                dialogForm: false,
                form: {},
            }
        },
        methods: {
            loadData(params) {
                console.log(params)
                getChangeAccountBill(params).then(res => {
                    console.log(res)
                    this.form = res.data

                })
            },
        }
    }
</script>

<style scoped>

</style>
